import 'package:flutter/material.dart';
import 'package:flutter_demo1/model/home_mo.dart';
import 'package:flutter_demo1/widget/hi_banner.dart';

class HomeTabPage extends StatefulWidget {
  String name;
  List<BannerMo>? bannerList;

  HomeTabPage(this.name, {super.key, this.bannerList});

  @override
  State<HomeTabPage> createState() => _HomeTabPageState();
}

class _HomeTabPageState extends State<HomeTabPage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: ListView(
        padding: EdgeInsets.only(top: 8),
        children: [if (widget.bannerList != null) _branner()],
      ),
    );
  }

  _branner() {
    return Padding(
      padding: EdgeInsets.only(left: 8, right: 8),
      child: HiBanner(widget.bannerList!),
    );
  }
}
